var app = angular.module('JiangGanApp')
app.service('DiagramService',Diagram)

function Diagram(){
	this.getRadar=function(dataMap){
		var option = {
		    tooltip: {
		    	trigger:'item',
		    	position:'right'
		    },
		    radar: {
		        indicator: dataMap.indicator
		    },
		    series: [{
		        name: dataMap.name,
		        type: 'radar',
		        data : [
		            {
		                value : dataMap.data,
		                name : ''
		            }
		        ],
		        itemStyle:{
		        	normal:{
		        		color:'#3980FF',
		        		borderColor:'#3980FF',
		        		borderWidth:2
		        	}
		        },
		        areaStyle: {
                    normal: {
                            color: new echarts.graphic.RadialGradient(0.6, 1.12, 1, [
                                {
                                    color: '#C9DCFF',
                                    offset: 0
                                },
                                {
                                    color: '#3980FF',
                                    offset: 1
                                }
                            ])
                    }
                }
		    }]
		};
		return option;
	}
}